home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / shell.616 < prev    next >
Text File  |  1992-02-06  |  2KB  |  75 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw12720
  3. \paperh6420
  4. \margl120
  5. \margr2700
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 directory prompt csh\
  8. \
  9. Q:  How do I make my C-Shell prompt display the current directory?\
  10. \
  11. A: Use a collection of aliases.  The key is to alias each command which will change your working directory.  One example:\
  12. \
  13.  
  14. \pard\tx960\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs24\li720\fc0 set myhost=`hostname`\
  15. \
  16. # To include just the last component of the current directory\
  17. # in the prompt, uncomment the second of these and comment\
  18. # out the first.\
  19. \
  20. alias SetPrompt    'set prompt="$\{myhost\} [$cwd]-\\\\!% "'\
  21. #alias SetPrompt    'set prompt="$\{myhost\} [$cwd:t]-\\\\!% "'\
  22. \
  23. alias cd    'cd \\!* && SetPrompt'\
  24. alias cdl    'cd \\!*; ls'\
  25. alias popd    'popd \\!* && SetPrompt'\
  26. alias pushd    'pushd \\!* && SetPrompt'\
  27.  
  28. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\fs28\fc0 \
  29. You can include the 
  30. \b alias
  31. \b0  commands in your 
  32. \b ~/.login
  33. \b0 , in your 
  34. \b ~/.cshrc
  35. \b0 , or, for example, in a file called 
  36. \b ~/.aliases
  37. \b0  which is invoked in 
  38. \b .login
  39. \b0  or 
  40. \b .cshrc
  41. \b0 .  The 
  42. \b .login
  43. \b0 \
  44. file is invoked each time you log in.  The 
  45. \b .cshrc
  46. \b0  file is invoked everytime you\
  47. start up a new c-shell process.  To invoke 
  48. \b ~/.aliases
  49. \b0  from either of these files\
  50. use:\
  51.     
  52. \f0\fs24 source ~/.aliases
  53. \f2\fs28 \
  54.     \
  55. Note also the alias 
  56. \b cdl
  57. \b0 .  This does a 
  58. \b cd
  59. \b0  and then an 
  60. \b ls
  61. \b0 .  The 
  62. \i aliased
  63. \i0  version of 
  64. \b cd
  65. \b0  will be used by 
  66. \b cdl
  67. \b0 .\
  68. \
  69. QA616\
  70. \
  71. Valid for 1.0 \
  72. Valid for 2.0\
  73. \
  74.  
  75.